<?php
include 'dbconfig.php'; 

$uid = 0;

mysql_select_db($db, $con);

$query = "SELECT * FROM modules ORDER BY id ASC";
$result = mysql_query($query);

$strarray = "[\n";
$f = 0;
while ($row = mysql_fetch_array($result)) {
	if ($f != 0) $strarray .= ",\n";
	$desc = str_replace("'", '"', $row['desc']);
	$strarray .= "    ['".$row['name']."','".$row['area']."',".$row['comp'].",".$row['ects'].",'".$desc."']";
	
	$f++;
}
$strarray .= "];";

echo $strarray;

mysql_close($con);
?>
